package ca.etsmtl.log430.lab3;

import java.util.Observable;

/**
 * MODIF 1
 * Display list of course a student has succeed
 * @author Alexandre Parent
 *
 */
public class StudentCourseSucceed extends Communication {

	public StudentCourseSucceed(Integer registrationNumber, String componentName) {
		super(registrationNumber, componentName);
	}

	public void update(Observable thing, Object notificationNumber) {

		if (registrationNumber.compareTo((Integer) notificationNumber) == 0) {

			Student student = null;
			Menus menu = new Menus();
			Displays display = new Displays();
			
			addToReceiverList("ListStudentsComponent");
			signalReceivers("ListStudentsComponent");
		
			student = menu.pickStudent(CommonData.theListOfStudents.listOfStudents);

			display.displayStudentCoursesTaken(student);
		}
	}
}
